/* jshint esversion:6 */
import React, {
  Component,
  PropTypes
} from 'react';

import { connect } from 'react-redux';
import { browserHistory } from 'react-router';
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';

import AppBar from 'material-ui/AppBar';

class App extends Component {
  constructor(props) {
    super(props);
  }
  render() {
    let { isLogin, routing } = this.props;
    isLogin = true;
    console.log('routing');
    console.log(routing);
    return (
      <div>
        {isLogin ? <AppBar title="Title" showMenuIconButton={false} /> : null}
        <ReactCSSTransitionGroup
          component="div"
          transitionName="example"
          transitionEnterTimeout={500}
          transitionLeaveTimeout={500}
        >
          {React.cloneElement(this.props.children, {
            key: location.pathname
          })}
        </ReactCSSTransitionGroup>
      </div>
    );
  }
}

App.PropTypes = {
  // Injected by React Redux
  // errorMessage: PropTypes.string,
  // resetErrorMessage: PropTypes.func.isRequired,
  // inputValue: PropTypes.string.isRequired,
  // Injected by React Router
  children: PropTypes.node
}

const mapStateToProps = (state, ownProps) => ({
  routing: state.routing
  // errorMessage: state.errorMessage,
  // inputValue: ownProps.location.pathname.substring(1)
})

export default connect(mapStateToProps, {
  // resetErrorMessage
})(App)
